return nr_doms;
}
+int xc_domain_getfullinfo(int xc_handle,
+ u32 domid,
+ dom0_op_t *op,
+ full_execution_context_t *ctxt )
+{
+ int rc;
+ op->cmd = DOM0_GETDOMAININFO;
+ op->u.getdomaininfo.domain = (domid_t)domid;
+ op->u.getdomaininfo.ctxt = ctxt;
+
+ rc = do_dom0_op(xc_handle, op);
+ if ( ((u32)op->u.getdomaininfo.domain != domid) && rc > 0 )
+ return -ESRCH;
+ else
+ return rc;
+}
+
+
int xc_shadow_control(int xc_handle,
u32 domid,
unsigned int sop,
/* Ensure that the domain exists, and that it is stopped. */
- if ( xc_domain_pause( xc_handle, domid, &op, &ctxt ) )
+ if ( xc_domain_pause( xc_handle, domid ) )
{
PERROR("Could not pause domain");
goto out;
}
+ if ( xc_domain_getfullinfo( xc_handle, domid, &op, &ctxt) )
+ {
+ PERROR("Could not get full domain info");
+ goto out;
+ }
memcpy(name, op.u.getdomaininfo.name, sizeof(name));
shared_info_frame = op.u.getdomaininfo.shared_info_frame;
pgd[HYPERVISOR_VIRT_START>>L2_PAGETABLE_SHIFT]>>PAGE_SHIFT;
live_mfn_to_pfn_table =
- mfn_mapper_map_single(xc_handle, ~0ULL,
+ mfn_mapper_map_single(xc_handle, ~0UL,
PAGE_SIZE*1024, PROT_READ,
mfn_to_pfn_table_start_mfn );
}
DPRINTF("Start last iteration\n");
last_iter = 1;
- xc_domain_pause( xc_handle, domid, &op, NULL );
+ xc_domain_pause( xc_handle, domid );
}
}
/* Get the final execution context */
- op.cmd = DOM0_GETDOMAININFO;
- op.u.getdomaininfo.domain = (domid_t)domid;
- op.u.getdomaininfo.ctxt = &ctxt;
- if ( (do_dom0_op(xc_handle, &op) < 0) ||
- ((u32)op.u.getdomaininfo.domain != domid) )
+ if ( xc_domain_getfullinfo( xc_handle, domid, &op, &ctxt) )
{
- PERROR("Could not get info on domain");
+ PERROR("Could not get full domain info");
goto out;
}
{
int i;
- sc->stats.fault_count = p->mm.shadow_fault_count;
- sc->stats.dirty_count = p->mm.shadow_dirty_count;
- sc->stats.dirty_net_count = p->mm.shadow_dirty_net_count;
- sc->stats.dirty_block_count = p->mm.shadow_dirty_block_count;
+ sc->stats.fault_count = d->mm.shadow_fault_count;
+ sc->stats.dirty_count = d->mm.shadow_dirty_count;
+ sc->stats.dirty_net_count = d->mm.shadow_dirty_net_count;
+ sc->stats.dirty_block_count = d->mm.shadow_dirty_block_count;
if( d->tot_pages > sc->pages ||
!sc->dirty_bitmap || !d->mm.shadow_dirty_bitmap )